home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1570 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: library.erc.clarkson.edu!rpi!not-for-mail
  2. From: floydb1@lib104.its.rpi.edu (Barry B Floyd)
  3. Newsgroups: comp.lang.c++
  4. Subject: HELP: syntax calling member fn() of returned object
  5. Date: 11 Jan 1996 12:13:19 -0500
  6. Organization: Rensselaer Polytechnic Institute, Troy, NY.
  7. Message-ID: <4d3gff$ga4@lib104.its.rpi.edu>
  8. NNTP-Posting-Host: lib104.its.rpi.edu
  9. X-newsreader: xrn 7.04-beta-11
  10.  
  11.  
  12.  
  13. What is the syntax (if any) for calling a member function
  14. of a returned object. For example:
  15.  
  16. // --------------------------------------
  17. String     MyClass::Function  ( ... )
  18. {
  19.     // code
  20. }
  21.  
  22. // --------------------------------------
  23. int     Myclass::AnotherFn ( ... )
  24. {
  25.     String a_string ;
  26.  
  27.     a_string = Function (  ... ) ;
  28.  
  29.     if ( a_string.length () == 0 )
  30.         // code
  31. }
  32.     
  33. // --------------------------------------
  34.  
  35. I would rather not have to do:
  36.  
  37.     String a_string ;
  38.  
  39.     a_string = Function (  ... ) ;
  40.  
  41. I would rather do something like:
  42.  
  43.     if ( Function (  ... ).length () == 0 )
  44.  
  45.  
  46.  
  47.  
  48. thanks (e-mail or post)
  49.  
  50. barry
  51. -- 
  52. +--------------------------------------------------------------------+ 
  53. | Barry B. Floyd                   \\\               floydb1@rpi.edu |
  54. | RPI Alum. '84 '87 '88              \\\                             |
  55. +--------------------------------------------------------------------+
  56.